Option Strict Off
Option Explicit On
Friend Class frmL1
	Inherits System.Windows.Forms.Form
    Dim snd As Boolean = False
    Dim NO As Short = 1
    Dim SoundInst As New SoundClass
    Private Sub frmL1_KeyDown(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
        Dim KeyCode As Short = eventArgs.KeyCode
        Dim Shift As Short = eventArgs.KeyData \ &H10000
        Select Case KeyCode
            Case 37
                If VB6.PixelsToTwipsX(Img.Left) > 75 Then Img.Left = VB6.TwipsToPixelsX(VB6.PixelsToTwipsX(Img.Left) - 70)
                Img.Image = ImgL.Image
            Case 39
                If VB6.PixelsToTwipsX(Img.Left) < 6275 Then Img.Left = VB6.TwipsToPixelsX(VB6.PixelsToTwipsX(Img.Left) + 70)
                Img.Image = ImgR.Image
            Case 38
                Img.Image = ImgU.Image
            Case 40
                Img.Image = ImgU.Image
            Case 32
                If Timer1.Enabled = False Then
                    ImgS.Left = VB6.TwipsToPixelsX(VB6.PixelsToTwipsX(Img.Left) + 60)
                    Timer1.Enabled = True
                End If
        End Select
    End Sub
    Private Sub Image1_DoubleClick(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Image1.DoubleClick
        Dim a As Object
        a = InputBox("")
        Select Case a
            Case "2"
                T.Enabled = False
                Me.Hide()
                frmL2.DefInstance.Show()
            Case "3"
                T.Enabled = False
                Me.Hide()
                frmL3.DefInstance.Show()
            Case "4"
                T.Enabled = False
                Me.Hide()
                frmL4.DefInstance.Show()
        End Select
    End Sub
    Private Sub T_Tick(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles T.Tick
        If NO <= 10 Then
            ImgW(NO).Visible = True
            ImgW(NO).Top = VB6.TwipsToPixelsY(VB6.PixelsToTwipsY(ImgW(NO).Top) + 100)
            If VB6.PixelsToTwipsY(ImgW(NO).Top) >= VB6.PixelsToTwipsY(Img.Top) Then
                ImgW(NO).Visible = False
                Call OH()
            End If
        ElseIf NO > 10 Then
            If CDbl(lbRe.Text) < 8 Or Label3.Visible = False Then
                T.Enabled = False
                Me.Hide()
                '         MsgBox("Game Over !!", MsgBoxStyle.Critical, "Sorry")
                End
            Else
                T.Enabled = False
                Me.Hide()
                frmL2.DefInstance.Show()
            End If
        End If
    End Sub
    Private Sub Timer1_Tick(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Timer1.Tick
        Dim SND_ASYNC As Object
        On Error Resume Next
        If NO > 10 Then Timer1.Enabled = False : Exit Sub
        ImgS.Top = VB6.TwipsToPixelsY(VB6.PixelsToTwipsY(ImgS.Top) - 50)
        If snd = False Then
            SoundInst.PlaySoundFile(VB6.GetPath & "\B1.wav")
            ImgS.Left = VB6.TwipsToPixelsX(VB6.PixelsToTwipsX(Img.Left) + 60)
            snd = True
        End If
        If VB6.PixelsToTwipsY(ImgS.Top) <= 4750 Then ImgS.Visible = True
        If VB6.PixelsToTwipsY(ImgS.Top) < -550 Then
            Timer1.Enabled = False
            ImgS.Visible = False
            snd = False
            ImgS.Top = VB6.TwipsToPixelsY(5400)
            ImgS.Left = VB6.TwipsToPixelsX(VB6.PixelsToTwipsX(Img.Left) + 60)
        End If
        If Collided(ImgS, ImgW(NO)) Then
            SoundInst.PlaySoundFile(VB6.GetPath & "\B2.wav")
            ImgW(NO).Visible = False
            lbRe.Text = CStr(CDbl(lbRe.Text) + 1)
            If CDbl(lbRe.Text) >= 8 Then
                T.Enabled = False
                Me.Hide()
                frmL2.DefInstance.Show()
            End If
            NO += 1
            Timer1.Enabled = False
            ImgS.Visible = False
            snd = False
            ImgS.Top = VB6.TwipsToPixelsY(5400)
            ImgS.Left = VB6.TwipsToPixelsX(VB6.PixelsToTwipsX(Img.Left) + 60)
        End If
    End Sub
    Private Sub Timer3_Tick(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Timer3.Tick
        If Label5.Text = "Arab Team 2000" Then
            Label5.Text = "Level 1"
        ElseIf Label5.Text = "Level 1" Then
            Label5.Text = "GO !!"
        ElseIf Label5.Text = "GO !!" Then
            Label5.Visible = False
            T.Enabled = True
        End If
    End Sub
    Private Sub OH()
        On Error Resume Next
        ImgW(NO).Visible = False
        NO += 1
        If Label1.Visible = True Then
            Label1.Visible = False
        ElseIf Label1.Visible = False And Label2.Visible = True Then
            Label2.Visible = False
        ElseIf Label1.Visible = False And Label2.Visible = False And Label3.Visible = True Then
            Label3.Visible = False
            '    MsgBox("Game Over !!", MsgBoxStyle.Critical, "Sorry")
            End
        End If
    End Sub
    Private Sub frmL1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
        End
    End Sub
End Class